<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
</head>
<body>
<h1>养老院注册中心</h1>
<form action="#" th:action="@{/doRegister}" role="form" th:object="${user}" th:method="post">
    用户名：<input type="text" name="name" th:field="*{name}"/><span th:errors="*{name}"></span><br/>
    密码：<input type="text" name="password" th:field="*{password}"/><span th:errors="*{password}"></span><br/>
    <!--为了演示把type改成text-->
    邮箱：<input type="text" name="email" th:field="*{email}"/><span th:errors="*{email}"></span><br/>
    年龄：<input type="number" name="age" th:field="*{age}"/><span th:errors="*{age}"></span><br/>
    区域：<select th:field="*{area}" th:switch="*{area}" name="area">
            <option th:text="请选择区域" value=""></option>
            <option th:text="高新" th:value="GAO_XIN"></option>
            <option th:text="青山湖" th:value="QING_SHAN_HU"></option>
            <option th:text="经开" th:value="JING_KAI"></option>
          </select><span th:errors="*{area}"></span><br/>
    <input type="submit"/>
</form>
</body>
</html>